import 'package:flutter/material.dart';

class StockReports extends StatelessWidget {
  const StockReports({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    // ئەكراننىڭ كەڭلىكىگە قاراپ، دوكلاتلارنى تىك ياكى يانتۇ تىزىش
    final screenWidth = MediaQuery.of(context).size.width;
    final isWideScreen = screenWidth >= 1200;

    if (isWideScreen) {
      // كەڭ ئېكران ئۈچۈن يانتۇ تىزىش
      return Padding(
        padding: const EdgeInsets.all(16.0),
        child: Row(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            Expanded(child: _buildSimpleLowStockContainer()),
            const SizedBox(width: 24),
            Expanded(child: _buildSimpleOverstockedContainer()),
          ],
        ),
      );
    } else {
      // تار ئېكران ئۈچۈن تىك تىزىش
      return Padding(
        padding: const EdgeInsets.all(16.0),
        child: Column(
          mainAxisSize: MainAxisSize.min,
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            _buildSimpleLowStockContainer(),
            const SizedBox(height: 24),
            _buildSimpleOverstockedContainer(),
          ],
        ),
      );
    }
  }

  // ئاددىيلاشتۇرۇلغان ئامباردا ئاز قالغان ماللار كونتېينېرى
  Widget _buildSimpleLowStockContainer() {
    return Container(
      width: double.infinity,
      padding: const EdgeInsets.all(16),
      decoration: BoxDecoration(
        color: Colors.white,
        borderRadius: BorderRadius.circular(8),
        boxShadow: [
          BoxShadow(
            color: Colors.grey.withOpacity(0.1),
            blurRadius: 4,
            offset: const Offset(0, 2),
          ),
        ],
      ),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        mainAxisSize: MainAxisSize.min,
        children: [
          const Text(
            'ئامباردا ئاز قالغان ماللار',
            style: TextStyle(
              fontSize: 18,
              fontWeight: FontWeight.w500,
            ),
          ),
          const SizedBox(height: 16),
          Container(
            height: 150,
            alignment: Alignment.center,
            child: const Text(
              'ئامباردا ئاز قالغان ماللار تىزىملىكى (ۋاقىتلىق ئۆچۈرۈلدى)',
              style: TextStyle(
                fontSize: 16,
                color: Colors.grey,
              ),
              textAlign: TextAlign.center,
            ),
          ),
        ],
      ),
    );
  }

  // ئاددىيلاشتۇرۇلغان ئامباردا بېسىلىپ قالغان ماللار كونتېينېرى
  Widget _buildSimpleOverstockedContainer() {
    return Container(
      width: double.infinity,
      padding: const EdgeInsets.all(16),
      decoration: BoxDecoration(
        color: Colors.white,
        borderRadius: BorderRadius.circular(8),
        boxShadow: [
          BoxShadow(
            color: Colors.grey.withOpacity(0.1),
            blurRadius: 4,
            offset: const Offset(0, 2),
          ),
        ],
      ),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        mainAxisSize: MainAxisSize.min,
        children: [
          const Text(
            'ئامباردا بېسىلىپ قالغان ماللار',
            style: TextStyle(
              fontSize: 18,
              fontWeight: FontWeight.w500,
            ),
          ),
          const SizedBox(height: 16),
          Container(
            height: 150,
            alignment: Alignment.center,
            child: const Text(
              'ئامباردا بېسىلىپ قالغان ماللار تىزىملىكى (ۋاقىتلىق ئۆچۈرۈلدى)',
              style: TextStyle(
                fontSize: 16,
                color: Colors.grey,
              ),
              textAlign: TextAlign.center,
            ),
          ),
        ],
      ),
    );
  }
} 